#!/bin/sh

echo "[INFO] [$(date '+%Y-%m-%d %H:%M:%S')] application jhiipster-registry."

if [ -n "$WAIT_HOSTS" ]; then
    echo "[INFO] 检测依赖环境."
    chmod +x /wait
    /wait
fi

if [ -n "$CENTRAL_CONFIG" ]; then
    echo "[INFO] 下载/解压中央配置文件. URL: $CENTRAL_CONFIG"
    wget -c $CENTRAL_CONFIG
    file_name="$(echo $CENTRAL_CONFIG | awk -F '/' '{print $NF}')"
    tar xf $file_name -C /
fi

exec "$@"